﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="printTable.aspx.cs" Inherits="permit.PollingTable.printTable" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            position: absolute;
            top: 27mm;
            left: 88mm;
            width: 140mm;
        }
        </style>
</head>
<script type="text/javascript">
    var hkey_root, hkey_path, hkey_key
    hkey_root = "HKEY_CURRENT_USER"
    hkey_path = "\\Software\\Microsoft\\Internet   Explorer\\PageSetup\\"
    //设置网页打印的页眉页脚为空   
    function pagesetup_null() {
        try {
            var RegWsh = new ActiveXObject("WScript.Shell")
            hkey_key = "header"
            RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, "")
            hkey_key = "footer"
            RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, "")
        } catch (e) { }
    }

    //用于设置打印参数
    function printBase() {
        factory.printing.header = "";   //页眉
        factory.printing.footer = "";   //页脚
        factory.printing.portrait = false;    //true为纵向打印，false为横向打印
        factory.printing.leftMargin = 0.5;
        factory.printing.topMargin = 0.5;
        factory.printing.rightMargin = 0.5;
        factory.printing.bottomMargin = 0.5;

    }

    //用于调用设置打印参数的方法和显示预览界面
    function printReport() {
        printBase();
        pagesetup_null();

        factory.printing.Preview();

    }

    //使界面最大化
    maxWin();
    function maxWin() {
        var aw = screen.availWidth;
        var ah = screen.availHeight;
        window.moveTo(0, 0);
        window.resizeTo(aw, ah);
    }

    function printTure() {

        printBase();
        factory.printing.Print(false);

    }
</script>
<body>
<object id="factory" style="display:none" height="0" width="0" 
      classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
      codebase="./print/ActiveX/smsx.cab#Version=6,4,438,06">
    </object>
    <form id="form1" runat="server">
       <div id="print" style="margin-right: 0px" runat="server">         
           
        <asp:Label ID="lblDep" runat="server" Text="城关区2009年餐饮服务许可证发放登记表" Font-Size="18pt"
            Font-Names="宋体" CssClass="style1"></asp:Label>
       </div>
    </form>
</body>
</html>
